ES6 新功能


Posted by Rich on 2021-04-25

let name = rich
console.log(`hello ${name}`)
//output: hello rich
var  obj = {
    a:1,
    b:2
}
var obj2 = {
    ...obj,   ///destructuring
    c: 3
}
var {a, ...rest} = obj2 //rest parameters
console.log(rest)
//output:{b: 2, c: 3}









Related Posts

[Day 05] 走訪器模式,建造者模式,責任鏈模式,解譯器模式

[Day 05] 走訪器模式,建造者模式,責任鏈模式,解譯器模式

GitHub Actions CI:導入與優化 ESLint 檢查

GitHub Actions CI:導入與優化 ESLint 檢查

JQ總務處|jQuery與JavaScript|深入淺出jQuery

JQ總務處|jQuery與JavaScript|深入淺出jQuery


Comments